﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TouShuShenQi.BlazorCore.Models
{
    public abstract class BaseModel<TKey> : PrivateBaseModel<TKey>
    {
    }

    /// <summary>
    /// 模型基类-只带有编号
    /// </summary>
    /// <typeparam name="TKey"></typeparam>
    public abstract class BaseFullModel<TKey> : PrivateFullModel<TKey>
    {

    }




    /// <summary>
    /// 只带有主键的
    /// </summary>
    /// <typeparam name="TKey">主键类型</typeparam>
    public abstract class PrivateBaseModel<TKey>
    {
        /// <summary>
        /// 主键Id
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public virtual TKey Id { get; set; }
    }

    /// <summary>
    /// 带有所有信息
    /// </summary>
    /// <typeparam name="TKey">主键类型</typeparam>
    public abstract class PrivateFullModel<TKey> : PrivateBaseModel<TKey>
    {
        /// <summary>
        /// 创建时间
        /// </summary>
        public virtual DateTime CreatedTime { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public virtual DateTime? UpdatedTime { get; set; }
 
    }
}
